﻿namespace LinkedTU.Models
{
    using LinkedTU.Common.Constants;
    using System;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    public class TakenCourse : BaseDbEntity
    {
        public DateTime DateTaken { get; set; }

        public bool ApprovedByLeadProfessor { get; set; }

        [MinLength(ValidationConstants.MaxTakenCourseNoteLength)]
        public string Note { get; set; }

        [Key]
        [ForeignKey("Course")]
        [Column(Order = 1)]
        public int CourseId { get; set; }

        public virtual Course Course { get; set; }

        [Key]
        [ForeignKey("User")]
        [Column(Order = 2)]
        public string UserId { get; set; }

        public ProfileInfo User { get; set; }
    }
}
